package org.xlx.xlx_oa.attendance.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xlx.xlx_oa.attendance.api.AttendanceApi;
import org.xlx.xlx_oa.attendance.domain.vo.AttendanceVo;
import org.xlx.xlx_oa.attendance.service.AttendanceService;
import org.xlx.xlx_oa.common.ResponseBean;

@RestController
@RequestMapping("/v1/attendance")
public class AttendanceController implements AttendanceApi {
    @Autowired
    private AttendanceService attendanceService;

    @PostMapping("/attend")
    @Override
    public ResponseBean<String> attend(@RequestBody AttendanceVo attendanceVo) {
        String result = attendanceService.checkAttendance(attendanceVo);
        return ResponseBean.successFactory(result);
    }
}

